<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改作物种植信息')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="crop-edit" th:object="${cropMap}">
			<input id="cropId" name="cropId" type="hidden" th:field="*{cropId}"/>
			<input id="lng" name="lng" type="hidden" th:field="*{lng}"/>
			<input id="lat" name="lat"  type="hidden" th:field="*{lat}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label">县区名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="cityName" id="cityName" th:field="*{cityName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">林业局、农场：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="townName" id="townName" th:field="*{townName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">农户、合作社：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="custName" id="custName" th:field="*{custName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">详细地址：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="address" id="address" th:field="*{address}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">联系电话：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="linkPhone" id="linkPhone" th:field="*{linkPhone}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">作物名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="cropName" id="cropName" th:field="*{cropName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">种植面积：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="mianji" id="mianji" th:field="*{mianji}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">作物分类：</label>
				<div class="col-sm-8">
					<select name="sort1" class="form-control m-b" th:with="type=${@dict.getType('crop_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sort1}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">生长周期：</label>
				<div class="col-sm-8">
					<select name="sort2" class="form-control m-b" th:with="type=${@dict.getType('crop_year')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sort2}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "cropmanage";

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#crop-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
